//
//  BCUserInfoCell1.m
//  BangcaiBuy
//
//  Created by lsy on 16/6/28.
//  Copyright © 2016年 BCB. All rights reserved.
//

#import "BCUserInfoCell1.h"


@interface BCUserInfoCell1()
{
    UILabel *infoNameLab;
    UITextField *info;
    UILabel *line;
    UIImageView *arrow;
}
@end

@implementation BCUserInfoCell1


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}


- (void)createView
{
    infoNameLab = [[UILabel alloc] init];
    
    arrow = [[UIImageView alloc] init];
    arrow.image = [UIImage imageNamed:@"下一步-灰"];
    info = [[UITextField alloc] init];
    line = [[UILabel alloc] init];
    line.backgroundColor = [UIColor colorWithRed:0.851  green:0.851  blue:0.851 alpha:1];
    [self.contentView addSubview:arrow];
    [self.contentView addSubview:infoNameLab];
    [self.contentView addSubview:info];
    [self.contentView addSubview:line];
    infoNameLab.font = [UIFont boldSystemFontOfSize:16];
    infoNameLab.textColor = [UIColor darkGrayColor];
    info.textAlignment = NSTextAlignmentRight;
    
    info.font = [UIFont systemFontOfSize:15];
}

- (void)layoutSubviews{
    infoNameLab.text = self.infoName;
    info.text = self.placeholder;
    
    [infoNameLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.equalTo(self.contentView);
        make.width.mas_equalTo(150);
        make.top.equalTo(self.contentView);
        make.left.mas_equalTo(10);
    }];
    [info mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.and.top.equalTo(self.contentView);
        make.right.mas_equalTo(0).with.offset(-33);
    }];
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(1);
        make.centerX.mas_equalTo(0);
        make.width.mas_equalTo(SCREEN_WIDTH - 24);
        make.bottom.equalTo(self.contentView);
    }];
    
    [arrow mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(20 *hx);
        make.left.mas_equalTo(info.mas_right).with.offset(6);
        make.right.mas_equalTo(-12);
        make.centerY.mas_equalTo(0);
        
        
    }];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
